\(\int \cos (a+b x) \sin (2 a+2 b x) \, dx\) [135]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 30 \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos (a+b x)}{2 b}-\frac {\cos (3 a+3 b x)}{6 b} \]

[Out]

-1/2*cos(b*x+a)/b-1/6*cos(3*b*x+3*a)/b

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {4369} \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos (a+b x)}{2 b}-\frac {\cos (3 a+3 b x)}{6 b} \]

[In]

Int[Cos[a + b*x]*Sin[2*a + 2*b*x],x]

[Out]

-1/2*Cos[a + b*x]/b - Cos[3*a + 3*b*x]/(6*b)

Rule 4369

Int[cos[(c_.) + (d_.)*(x_)]*sin[(a_.) + (b_.)*(x_)], x_Symbol] :> Simp[-Cos[a - c + (b - d)*x]/(2*(b - d)), x]
 - Simp[Cos[a + c + (b + d)*x]/(2*(b + d)), x] /; FreeQ[{a, b, c, d}, x] && NeQ[b^2 - d^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\cos (a+b x)}{2 b}-\frac {\cos (3 a+3 b x)}{6 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.50 \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=-\frac {2 \cos ^3(a+b x)}{3 b} \]

[In]

Integrate[Cos[a + b*x]*Sin[2*a + 2*b*x],x]

[Out]

(-2*Cos[a + b*x]^3)/(3*b)

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.90

method result size
default \(-\frac {\cos \left (x b +a \right )}{2 b}-\frac {\cos \left (3 x b +3 a \right )}{6 b}\) \(27\)
risch \(-\frac {\cos \left (x b +a \right )}{2 b}-\frac {\cos \left (3 x b +3 a \right )}{6 b}\) \(27\)
parallelrisch \(\frac {4 \tan \left (x b +a \right )^{2}-4 \tan \left (x b +a \right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )+4 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{3 b \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right ) \left (1+\tan \left (x b +a \right )^{2}\right )}\) \(74\)
norman \(\frac {-\frac {4 \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (x b +a \right )}{3 b}+\frac {4 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{3 b}+\frac {4 \tan \left (x b +a \right )^{2}}{3 b}}{\left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right ) \left (1+\tan \left (x b +a \right )^{2}\right )}\) \(79\)

[In]

int(cos(b*x+a)*sin(2*b*x+2*a),x,method=_RETURNVERBOSE)

[Out]

-1/2*cos(b*x+a)/b-1/6*cos(3*b*x+3*a)/b

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.43 \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=-\frac {2 \, \cos \left (b x + a\right )^{3}}{3 \, b} \]

[In]

integrate(cos(b*x+a)*sin(2*b*x+2*a),x, algorithm="fricas")

[Out]

-2/3*cos(b*x + a)^3/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (24) = 48\).

Time = 0.17 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.77 \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=\begin {cases} - \frac {\sin {\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )}}{3 b} - \frac {2 \cos {\left (a + b x \right )} \cos {\left (2 a + 2 b x \right )}}{3 b} & \text {for}\: b \neq 0 \\x \sin {\left (2 a \right )} \cos {\left (a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(b*x+a)*sin(2*b*x+2*a),x)

[Out]

Piecewise((-sin(a + b*x)*sin(2*a + 2*b*x)/(3*b) - 2*cos(a + b*x)*cos(2*a + 2*b*x)/(3*b), Ne(b, 0)), (x*sin(2*a
)*cos(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.87 \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=-\frac {\cos \left (3 \, b x + 3 \, a\right )}{6 \, b} - \frac {\cos \left (b x + a\right )}{2 \, b} \]

[In]

integrate(cos(b*x+a)*sin(2*b*x+2*a),x, algorithm="maxima")

[Out]

-1/6*cos(3*b*x + 3*a)/b - 1/2*cos(b*x + a)/b

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.43 \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=-\frac {2 \, \cos \left (b x + a\right )^{3}}{3 \, b} \]

[In]

integrate(cos(b*x+a)*sin(2*b*x+2*a),x, algorithm="giac")

[Out]

-2/3*cos(b*x + a)^3/b

Mupad [B] (verification not implemented)

Time = 19.79 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.43 \[ \int \cos (a+b x) \sin (2 a+2 b x) \, dx=\left \{\begin {array}{cl} x\,\left (2\,\sin \left (a\right )-2\,{\sin \left (a\right )}^3\right ) & \text {\ if\ \ }b=0\\ -\frac {3\,\cos \left (a+b\,x\right )+\cos \left (3\,a+3\,b\,x\right )}{6\,b} & \text {\ if\ \ }b\neq 0 \end {array}\right . \]

[In]

int(cos(a + b*x)*sin(2*a + 2*b*x),x)

[Out]

piecewise(b == 0, x*(2*sin(a) - 2*sin(a)^3), b ~= 0, -(3*cos(a + b*x) + cos(3*a + 3*b*x))/(6*b))